def fib():
	last = [0,1,1]
	while True:
		yield last[2]
		last[0] = last[1]
		last[1] = last[2]
		last[2] = last[0]+last[1]
start = 1
for x in fib():
	start = start+1
	if len(str(x)) == 1000:
		print(start)
		break